﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSharpCallPython
{
    class 方法一
    {
        //效率较低
            //string pythonFileNam = "PClass.py";
            //Stopwatch stopwatch = new Stopwatch();
            //stopwatch.Start(); //  开始监视代码运行时间   
            //ScriptRuntime sr = Python.CreateRuntime();
            //dynamic d = sr.UseFile(pythonFileNam);
            //for (int i = 0; i < 100; i++)
            //{
            //    Console.WriteLine(d.say("Hello Python!"));
            //}

            //stopwatch.Stop(); //  停止监视           
            //TimeSpan timespan = stopwatch.Elapsed; //  获取当前实例测量得出的总时间            
            //double hours = timespan.TotalHours; // 总小时            
            //double minutes = timespan.TotalMinutes;  // 总分钟            
            //double seconds = timespan.TotalSeconds;  //  总秒数            
            //double milliseconds = timespan.TotalMilliseconds;  //  总毫秒数
            //Console.WriteLine(milliseconds);
    }
}
